package com.yzt.minemodule.adapter;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.module.LoadMoreModule;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.yzt.zhuju.network.entity.game.GameListBean;
import com.yzt.zhuju.widget.tuiview.TUITextView;
import com.yzt.minemodule.R;
import com.yzt.plugin_imageloader.ImageLoadUtil;

/**
 * author : bob
 * date   : 2022/12/1
 * desc   : 用户页面的动态适配器
 */
public class UserActivityAdapter extends BaseQuickAdapter<GameListBean, BaseViewHolder> implements LoadMoreModule {

    public UserActivityAdapter() {
        super(R.layout.item_user_activity);
    }

    @Override
    protected void convert(BaseViewHolder holder, GameListBean item) {

        TUITextView tvStatus = holder.findView(R.id.tv_status);
        tvStatus.setSelected(item.getActivityStatus() == 20);
        holder.setText(R.id.tv_status, item.getActivityStatusInfo());
        holder.setVisible(R.id.img_play, item.getActivityFileType() == 2);

        holder.setText(R.id.tv_content, item.getActivitySubject());
        ImageLoadUtil.loadAvatar(getContext(), item.getAvatar(), holder.getView(R.id.tv_user_avatar));
        holder.setText(R.id.tv_nickname, item.getNickName());
        holder.setText(R.id.tv_share, item.getShareNum() + "");
        ImageLoadUtil.loadAvatar(getContext(), item.getCover(), holder.getView(R.id.iv_cover));
    }
}
